﻿Imports BUS
Imports DTO
Public Class Login

    'Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    '    Dim roomBUS As New RoomBUS
    '    Dim listRoom As List(Of RoomDTO) = roomBUS.GetListRoom()
    '    DataGridView1.DataSource = listRoom

    '    Dim roomWS As New ResortManagement.ResortSW.RoomWS
    '    TextBox1.Text = roomWS.HelloWorld()
    'End Sub

    Private Sub btnLogin_Click(sender As Object, e As EventArgs) Handles btnLogin.Click
        Try
            Dim staffBus As New StaffBUS()
            ' If Not txtID.Text.Trim.Equals("") AndAlso Not txtPassword.Text.Trim.Equals("") Then
            Dim staffDto As StaffDTO = staffBus.GetStaffByIdPass("1", "hoan") '(txtID.Text, txtPassword.Text)
            If staffDto.ID > 0 AndAlso Not staffDto.pssword.Equals("") Then
                Utilities.ConfigReader.SaveString("idLogin", staffDto.ID)         
                Form_Main.Show()
                Me.Hide()
            Else
                lblError.Text = "ID not exist or Password not correct!"
            End If
            'Else
            'lblError.Text = "ID or Password could not be blank!"
            'End If

        Catch ex As Exception
            Throw ex
        End Try
    End Sub
End Class
